import { FlowTemplateBelong } from '@prisma/client'
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'

export class FlowTemplate {
  static ApiPropertyEnum = {
    FlowTemplateBelong: [`${FlowTemplateBelong.System}--系统模板`, `${FlowTemplateBelong.Platform}--平台自定义模板`],
  }

  @ApiProperty({ description: 'ID', type: Number })
  id: number

  @ApiProperty({ description: '标题', type: String })
  label: string

  @ApiPropertyOptional({ description: '模板内容', type: String })
  content?: string

  @ApiProperty({ description: '模板归属', enum: FlowTemplate.ApiPropertyEnum.FlowTemplateBelong })
  belong: FlowTemplateBelong

  @ApiProperty({ description: '创建时间', type: Date })
  createTime: Date

  @ApiProperty({ description: '所属平台', type: String })
  platform: string

  @ApiPropertyOptional({ description: '所属平台下的项目', type: String })
  project?: string

  @ApiProperty({ description: '分组名称', type: String })
  groupLabel: string

  @ApiPropertyOptional({ description: '缩略图', type: String })
  thumbnail?: string

  @ApiPropertyOptional({ description: '排序号，降序', type: Number })
  sortNo?: number
}
